Skip to content

Sky Duel tune-up: bigger planes, a lighter HUD, and your rating in the briefing room - #279

Merged
ASCoding11 merged 7 commits into
ASCoding11:mainfrom
XxSxmpley:sky-duel-tuneup
Nov 20, 2026
Merged

ASCoding11 merged 7 commits into
ASCoding11:mainfrom
XxSxmpley:sky-duel-tuneup

Conversation

@XxSxmpley

Copy link
Copy Markdown
Contributor

A player asked for four things: no bots in party games, Elo for dogfights, a faster game, and slightly bigger planes. Two of those were already on main. This PR checks them, adds the small pieces that were missing, and does the other two.

What changed (only sky-duel/, the README, What's new)

  • Planes are about 15% bigger. A new PLANE_GROW constant (1.12 × 1.15) sets PLANE_SIZE and HIT_R, so the bullet hit sphere grows from 10.08 m to 11.59 m along with the planes. The spawn shield sphere (it had its own hard-coded 9*1.12), the HUD box size and the Paint Shop preview distances (pvShot in hangar.js) all scale with it too, so the previews frame the plane exactly as before. The cockpit view was already in built units (EYE, GLASS), so it stays right. These are unchanged: the missile fuse (17 m), the 2.2 m ground clearance (the lowest belly is now 1.6 m under the centre, still inside it) and the chase camera. Hits are decided by the shooter's browser, so a stale page in the same room still works and just uses its older radius.
  • The HUD does less work. HUD text (clock, scores, hull, ammo, speed, altitude, throttle and the names and distances under the boxes) is now written only when it changes, and it updates the existing text node instead of replacing it. Before, each of those writes replaced the node, which also woke lang.js's page-wide querySelector watcher about 170 times a second. The distance under each box now changes at most five times a second. Some style writes are now guarded as well: the #board hidden flag, the throttle fill, status visibility, the hull colour and the cockpit vignette, which was being written every frame. KB.held (which builds small arrays on every call) is skipped while no key is down.
  • Your rating shows in the briefing room, after the room code ("Room vq-… · 2 of 8 pilots · Your rating 1018", from BackRoomElo.get()). The Spanish is in es.js.
  • What's new entry (fix, no version number so it can't clash with other open PRs), with the Spanish in news-es.js. README section updated.

What was already on main (checked, not changed)

  • No bots in party rooms: isPartyRoom / partyRoom() match party.js's p + 6 characters. The Bots buttons are locked on Off and the "No bots in party games" note shows. hostStart seats only people and writes fill: 0. fixRoster drops any bot, including bots in an rs from someone else, and never puts a bot in a leaver's seat. This is the same pattern as Boostball. A room's code never changes, so "becoming" a party room isn't possible. The bots that could show up are ones already in the match record, and fixRoster removes those.
  • Elo: elo.js is loaded. rateMatch / rateNow reports every online mode (free-for-all by standings; duel and 2v2 by result) once per match. Solo, the menu dogfight, watching and leaving early don't count. Party rooms are rated, the same as every other game (no game excludes them). The end screen shows the new rating and the change. leaderboard.js already has the Sky Duel Elo board first, and stats.js already lists sky-duel.

Profiling (solo free-for-all, 5 Veteran bots, Playwright Chromium on Metal, 1280 × 800, seeded Math.random, 3 runs each, main vs this branch)

  • Page layouts per second: about 28 → about 13.5. Layout time: about 9 → 4 ms per second. DOM mutations per second: about 172 → about 77. Style recalcs are about the same (about 36/s, mostly from moving the HUD boxes).
  • Unchanged and already fine: 18 to 19 draw calls, about 90k triangles, 0.3 to 0.5 ms CPU per frame for sim + camera + planes + HUD + render submit, GPU about 2 to 4 ms per frame at 1280 × 800 (about 1.8 ms when throughput-batched at 2400 × 1500). Frames sit at 16.7 ms (vsync) before and after.
  • Under 4× CPU throttling the main thread was still about 75% idle, and garbage collection was about 0.3%. Per-frame JS allocation measures about 38 KB per frame before and after, spread thinly across the math in many functions. It isn't worth restructuring the file for that.
  • Honest summary: the earlier optimisation PR already did the big work (instancing, sky after solids, HUD writes guarded). The remaining measurable cost was HUD DOM churn, so that's what this fixes. Visuals are the same, and ../autores.js is still loaded straight after three.js.

How it was tested (local python3 -m http.server, Playwright Chromium)

  • Solo at desktop (1280 × 800) and on a phone upright (390 × 844) and sideways (844 × 390), in the chase and cockpit views: the bigger planes look right, the HUD doesn't overlap the controls, and there are no page errors. The Paint Shop's paint and nose previews (?paints=1) frame the bigger planes correctly.
  • Two windows in one online room (one desktop, one phone-sized). A free-for-all to 5 played to the end, and both ended with an Elo result: winner 1000 → 1018 (+18), loser 1000 → 982. The same was run for a duel and for 2v2 (2v2: +18 / −17). The rating saved both locally and through elo.js.
  • A party-code room (p + 6 characters, the shape party.js makes) with two windows and a saved Bots setting of 6. Both briefing rooms showed Bots locked on Off with the note. The match started with no bots (bl: [], fill: 0). Bots injected into the host's match record were gone again within a hostTick. The match was still Elo-rated.
  • The Back Room's What's new strip shows the new entry. node --check passes for the inline script, hangar.js, es.js, news.js and news-es.js, and there are no conflict markers.
  • Firebase anonymous sign-in worked (no auth/too-many-requests).

Not tested

  • A real Party-panel launch (playTogether in party.js across two Back Room tabs). I used the same room-code shape directly instead.
  • Real phones, slow school laptops, and the Spanish UI in play. The new Spanish lines were added but not looked at on screen.
  • A match against a stale page from before this change (the older hit radius on that side).

Nothing risky: no storage formats, room paths, Firebase rules or config changed. The only shared file touched is What's new. Another helper is adding a campaign mode in a separate branch off the same base; this PR only touches small, separate spots in sky-duel/index.html, so they should merge cleanly.

🤖 Generated with Claude Code

XxSxmpley and others added 5 commits November 20, 2026 12:03
…nd Paint Shop pictures to match

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… when it changes)

Halves the page layouts per second in a solo match (about 29 to 15) and the DOM
changes (about 170 to 90); nothing on screen looks different.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h with other open pull requests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@netlify

netlify Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

👷 Deploy request for cosmic-dasik-e73c56 pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 7396062

@netlify

netlify Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

👷 Deploy request for ascoding11 pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 7396062

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ASCoding11

Copy link
Copy Markdown
Owner

There are issues here. I cant say yes to the pull request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	e63334287a3deaa3/news-es.js
#	e63334287a3deaa3/news.js
@ASCoding11
ASCoding11 merged commit 50f0c5b into ASCoding11:main Nov 20, 2026
1 check passed
ASCoding11 pushed a commit that referenced this pull request Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants